package com.gwnet.shop.controller.api;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.gwnet.common.log.annotation.Log;
import com.gwnet.common.log.enums.BusinessType;
import com.gwnet.common.mybatis.core.page.TableDataInfo;
import com.gwnet.shop.controller.MBaseController;
import com.gwnet.shop.domain.OrderDelivery;
import com.gwnet.shop.service.IOrderDeliveryService;
import com.gwnet.shop.utils.AjaxResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * 订单发货Controller
 * @author 张万鹏
 * @date 2024-07-21
 */
@RestController
@RequestMapping("/api/orderdelivery")
public class OrderDeliveryApiController extends MBaseController
{
    @Resource
    private IOrderDeliveryService orderDeliveryService;

    /**
     * 修改订单 状态
     */
    @SaCheckPermission("shop:orderdelivery:edit")
    @Log(title = "订单", businessType = BusinessType.UPDATE)
    @PutMapping("/status")
    public AjaxResult changeStatusAndOrderInfoStatus(@RequestBody OrderDelivery orderDelivery)
    {
        return toAjax(orderDeliveryService.changeStatusAndOrderIfoStatus(orderDelivery));
    }
}
